﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Sharp.Infrastructure.Interfaces;
using Sharp.Portal;
using Sharp.Portal.AdminLTE;
using Sharp.Portal.Mvc.List;
using Sharp.Portal.Other;

namespace Sharp.WebBooter.Areas.Platform.Models
{
    [ModuleCode("AvailablePermissionManage"), Title("可用权限管理")]
    [DataHandler("SaveToPermission", "保存", 5, OnClientClick = "new AvailablePermission().saveToPermission();", Icon = "fa fa-user")]
    public class AvailablePermissionIndexViewModel : BSSharpTreeList, ITreeEntity<Guid>
    {

        public AvailablePermissionIndexViewModel()
        {
            this.Feature = ListFeature.MultiSelect;
            this.Breadcrumb = "<ol class=\"breadcrumb\"> <li><a href =\"@Url.Action(\"Index\", \"Home\")\"><i class=\"fa fa-home\"></i> 首页</a></li> <li class=\"active\">平台维护</li> </ol>";
            this.ImportJavascript = "~/Areas/Platform/Scripts/AvailablePermission.js";
        }
        /// <summary>
        /// Id
        /// </summary>
        public System.Guid Id { get; set; }
        /// <summary>
        /// 上级
        /// </summary>
        public System.Guid? ParentId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Column(Width = 80, Text = "排序", Order = 3)]
        public int OrderIndex
        {
            get;
            set;
        }
        /// <summary>
        /// 编码
        /// </summary>
        [Column(Width = 80, Text = "编码", Order = 2)]
        public string Code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        /// <value>标题</value>
        [TreeColumn(Text = "名称", Order = 1), QueryOption(Option = QueryFeature.DefualtQuery)]
        public string Title { get; set; }

        /// <summary>
        /// 为控件显示用的属性
        /// </summary>
        /// <![CDATA[<treegrid-@Model.Id treegrid-parent-@Model.ParentId>]]>
        public string Itemclass { get; set; }
        public List<AvailablePermissionIndexViewModel> Data { get; set; }
        [Column(Text = "分类", Order = 3, Align = Alignment.Center)]
        public string Category { get; set; }
        [Column(Text = "系统代码", Order = 4, Align = Alignment.Center)]
        public string SystemCode { get; set; }
    }
}